package com.ziguang.redwood.web.controller;

import java.util.List;

import com.jfinal.core.Controller;
import com.jfinal.ext.route.ControllerBind;
import com.jfinal.plugin.activerecord.Record;
import com.ziguang.redwood.web.service.ProductCenterService;
import com.ziguang.redwood.web.service.WebHomeService;

@ControllerBind(controllerKey = "/webHome", viewPath = "/")
public class WebHomeController extends Controller{
	
	/**
	 * 获取首页信息
	 */
	public void index(){
		List<Record> topImg = WebHomeService.me.findHomeImg();
		setAttr("topImg", topImg);
		List<Record> productType = ProductCenterService.me.findProductType();
		setAttr("productType", productType);
		List<Record> product = WebHomeService.me.findProduct();
		setAttr("productList", product);
		render("index.html");
		
	}
	
}
